package main

import (
	"fmt"
)

type ping struct {
	srcIP    string
	dstIP    string
	pktLen   int
	pktNum   int
	interval int
	timeout  int
	vpn      string
	ttl      int
	tos      int
}

// srcIP dstIP vpn will alloc from the same seq id pool
var (
	defaultPktLen   = 5
	defaultPktNum   = 10
	defaultInterval = 500
	defaultTimeout  = 500
	defaultVpn      = "echo"
	defaultTTL      = 255
	defaultTOS      = 255
)

func newDefaultPingTask() *ping {
	return &ping{
		pktLen:   defaultPktLen,
		pktNum:   defaultPktNum,
		interval: defaultInterval,
		timeout:  defaultTimeout,
		vpn:      defaultVpn,
		ttl:      defaultTTL,
		tos:      defaultTOS,
	}
}

func NewPingTask(opts ...option) *ping {
	p := newDefaultPingTask()
	for _, o := range opts {
		o(p)
	}
	return &ping{}
}

type option func(*ping)

func ParaSrcIP(s string) option { return func(p *ping) { p.srcIP = s } }

func ParaDstIP(s string) option { return func(p *ping) { p.dstIP = s } }


func newDemoTask()*ping{
	return &ping{

	}

}


// ping control

var PingCtrl = struct{
	ctrl map[string]int

}

func echoRequest(p *ping){


}




func InitPingTaskRun(){
	go func ()  {
		
	}()
}




func main() {
	fmt.Println("ping go!")
}
